//
//  RegistUserInfoController.m
//  Safflower
//
//  Created by 袁亮 on 2016/12/13.
//  Copyright © 2016年 Migic_Z. All rights reserved.
//

#import "RegistUserInfoController.h"
#import "RegistUserInfoView.h"
#import "RegistPwdController.h"

@interface RegistUserInfoController ()<RegistUserInfoDelegate>

@property (nonatomic, strong) RegistUserInfoView *registUserInfoView;

@end

@implementation RegistUserInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.baseTitle = @"用户必填";
    self.rightBtnTitle = @"返回";
    
    [self makeRegistUserInfoView];
}

- (void)makeRegistUserInfoView
{
    _registUserInfoView = [[RegistUserInfoView alloc]init];
    _registUserInfoView.delegate = self;
    [self.baseView addSubview:_registUserInfoView];
    [_registUserInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.right.mas_equalTo(0);
    }];
}

- (void)clickNextStepWithObject:(id)userInfo
{
    if ([userInfo isKindOfClass:[UserModel class]]) {
        UserModel *user = (UserModel *)userInfo;
        user.phone = self.phone;
        RegistPwdController *pwdController = [[RegistPwdController alloc]init];
        pwdController.user = user;
        [self.navigationController pushViewController:pwdController animated:YES];
    }else{
        [YJProgressHud showErrorHud:userInfo];
    }
}

- (void)clickRightButton
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
